/*     */ package com.openbravo.pos.forms;
/*     */ 
/*     */ import aaaCasher.casherForm;

import com.attilax.io.pathx;
import com.attilax.ui.SwtX;
import com.openbravo.format.Formats;
/*     */ import com.openbravo.pos.instance.AppMessage;
/*     */ import com.openbravo.pos.instance.InstanceQuery;

/*     */ import java.awt.EventQueue;
/*     */ import java.util.Locale;
/*     */ import java.util.logging.Level;
/*     */ import java.util.logging.Logger;

/*     */ import javax.swing.LookAndFeel;
/*     */ import javax.swing.UIManager;

import org.eclipse.swt.widgets.Display;
/*     */ import org.jvnet.substance.SubstanceLookAndFeel;
/*     */ import org.jvnet.substance.api.SubstanceSkin;
/*     */ 
/*     */ public class StartPOS
/*     */ {
	public static boolean isFileMode=false;
/*  38 */   private static Logger logger = Logger.getLogger("com.openbravo.pos.forms.StartPOS");
/*     */ 
/*     */   public static boolean registerApp()
/*     */   {
/*  48 */     InstanceQuery i = null;
/*     */     try {
/*  50 */       i = new InstanceQuery();
/*  51 */       i.getAppMessage().restoreWindow();
/*  52 */       return false; } catch (Exception e) {
/*     */     }
/*  54 */     return true;
/*     */   }
/*     */ 
/*     */   public static void main(  final String[] args)
/*     */   {
	pathx.isWebPathMode=true;
	System.out.println("--  ");
	System.out.println("aaccc");
/*  60 */     EventQueue.invokeLater(new Runnable()
/*     */     {
/*     */       public void run() {
/*  63 */         if (!StartPOS.registerApp()) {
/*  64 */           System.exit(1);
/*     */         }
String[] args2=args;
/*     */
 args2=new String[]{pathx.classPathParent_jensyegeor()+"/atipos.properties"};
 isFileMode=true;
/*  67 */         AppConfig config = new AppConfig( args2);
/*  68 */         config.load();
/*     */ 
/*  71 */         String slang = config.getProperty("user.language");
/*  72 */         String scountry = config.getProperty("user.country");
/*  73 */         String svariant = config.getProperty("user.variant");
/*  74 */         if ((slang != null) && (!slang.equals("")) && (scountry != null) && (svariant != null)) {
/*  75 */           Locale.setDefault(new Locale(slang, scountry, svariant));
/*     */         }
/*     */ 
/*  79 */         Formats.setIntegerPattern(config.getProperty("format.integer"));
/*  80 */         Formats.setDoublePattern(config.getProperty("format.double"));
/*  81 */         Formats.setCurrencyPattern(config.getProperty("format.currency"));
/*  82 */         Formats.setPercentPattern(config.getProperty("format.percent"));
/*  83 */         Formats.setDatePattern(config.getProperty("format.date"));
/*  84 */         Formats.setTimePattern(config.getProperty("format.time"));
/*  85 */         Formats.setDateTimePattern(config.getProperty("format.datetime"));
/*     */         try
/*     */         {
/*  90 */           Object laf = Class.forName(config.getProperty("swing.defaultlaf")).newInstance();
/*     */ 
/*  92 */           if ((laf instanceof LookAndFeel))
/*  93 */             UIManager.setLookAndFeel((LookAndFeel)laf);
/*  94 */           else if ((laf instanceof SubstanceSkin))
/*  95 */             SubstanceLookAndFeel.setSkin((SubstanceSkin)laf);
/*     */         }
/*     */         catch (Exception e) {
/*  98 */           StartPOS.logger.log(Level.WARNING, "Cannot set look and feel", e);
/*     */         }
/*     */ 
/* 101 */         String screenmode = config.getProperty("machine.screenmode");
/* 102 */         if ("fullscreen".equals(screenmode)) {
/* 103 */           JRootKiosk rootkiosk = new JRootKiosk();
/* 104 */           rootkiosk.initFrame(config);
/*     */         } else {
/* 106 */           JRootFrame rootframe = new JRootFrame();
/* 107 */           rootframe.initFrame(config);

/*     */         }

/*     */       }
/*     */     });

		Runnable r = new Runnable() {
		
			@Override
			public void run() {
				System.out.println("---------- will start swt thread...");
				final casherForm ef3=new casherForm();
				// ef3.show();
				SwtX ef = new SwtX();
				ef.threadRecycle4swimg();
				System.out.println("---------- root ok...");
		
			}
		};
		  r.run();
//EventQueue.invokeLater(r);
//		EventQueue.invokeLater(new Runnable()
//		/*     */{
//			/*     */public void run() {
//				System.out.println("---------- will start swt thread...");
//
//				Runnable r = new Runnable() {
//
//					@Override
//					public void run() {
//						SwtX ef = new SwtX();
//						ef.threadRecycle4swimg();
//						System.out.println("---------- root ok...");
//
//					}
//				};
//				Display.getDefault().asyncExec(r);
//
//			}
//		});
		
		
/*     */   }
/*     */ }

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.forms.StartPOS
 * JD-Core Version:    0.6.0
 */